package de.sendorian.app.forumArchive.script;


import static de.sendorian.app.forumArchive.matcher.ForumMatcher.*;

import java.util.LinkedHashSet;
import java.util.Set;

import org.joda.time.DateTime;
import org.junit.Test;

import de.sendorian.app.forumArchive.Compressor;
import de.sendorian.app.forumArchive.repository.ForumRepository;
import de.sendorian.db.DAO;

public class ActionScripts {

	@Test
	public void compressImagesInFolders() {
		Set<String> folders = new LinkedHashSet<String>();
		folders.add("<YourDownloadDir>/Objects and Textures (Isometric)/Mountains1");
		folders.add("<YourDownloadDir>/Objects and Textures (Modern,Sci-Fi)/Consoles");
		new Compressor().compressImagesInFolders(folders);
		DAO.shutdownDatabase();
	}

	@Test
	public void compressImagesInTopicsByDate() {
		DateTime start = new DateTime().withDate(2009, 7, 1);
		new Compressor().compressImages(new ForumRepository().findAll(),
		    matchesDateIntervalUntilNow(start));
		DAO.shutdownDatabase();
	}

}
